home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / Software / Servis / FFE / GRAPH.SWG / 0058_Portable PixMap or PPM.pas < prev    next >
Pascal/Delphi Source File  |  1997-05-11  |  4KB  |  115 lines

  1.  
  2.  
  3.      NAME
  4.           ppm - portable pixmap file format
  5.  
  6.      DESCRIPTION
  7.           The portable pixmap format is a lowest common denominator
  8.           color image file format.  The definition is as follows:
  9.  
  10.           - A "magic number" for identifying the file type.  A ppm
  11.             file's magic number is the two characters "P3".
  12.  
  13.           - Whitespace (blanks, TABs, CRs, LFs).
  14.  
  15.           - A width, formatted as ASCII characters in decimal.
  16.  
  17.           - Whitespace.
  18.  
  19.           - A height, again in ASCII decimal.
  20.  
  21.           - Whitespace.
  22.  
  23.           - The maximum color-component value, again in ASCII decimal.
  24.  
  25.           - Whitespace.
  26.  
  27.           - Width * height pixels, each three ASCII decimal values
  28.             between 0 and the specified maximum value, starting at the
  29.             top-left corner of the pixmap, proceeding in normal
  30.             English reading order.  The three values for each pixel
  31.             represent red, green, and blue, respectively; a value of 0
  32.             means that color is off, and the maximum value means that
  33.             color is maxxed out.
  34.  
  35.           - Characters from a "#" to the next end-of-line are ignored
  36.             (comments).
  37.  
  38.           - No line should be longer than 70 characters.
  39.  
  40.           Here is an example of a small pixmap in this format:
  41.           P3
  42.           # feep.ppm
  43.           4 4
  44.           15
  45.            0  0  0    0  0  0    0  0  0   15  0 15
  46.            0  0  0    0 15  7    0  0  0    0  0  0
  47.            0  0  0    0  0  0    0 15  7    0  0  0
  48.           15  0 15    0  0  0    0  0  0    0  0  0
  49.  
  50.           Programs that read this format should be as lenient as
  51.           possible, accepting anything that looks remotely like a
  52.           pixmap.
  53.  
  54.           There is also a variant on the format, available by setting
  55.           the RAWBITS option at compile time.  This variant is
  56.           different in the following ways:
  57.  
  58.           - The "magic number" is "P6" instead of "P3".
  59.  
  60.           - The pixel values are stored as plain bytes, instead of
  61.             ASCII decimal.
  62.  
  63.           - Whitespace is not allowed in the pixels area, and only a
  64.             single character of whitespace (typically a newline) is
  65.             allowed after the maxval.
  66.  
  67.           - The files are smaller and many times faster to read and
  68.             write.
  69.  
  70.           Note that this raw format can only be used for maxvals less
  71.           than or equal to 255.  If you use the ppm library and try to
  72.           write a file with a larger maxval, it will automatically
  73.           fall back on the slower but more general plain format.
  74.  
  75.      SEE ALSO
  76.           giftoppm(1), gouldtoppm(1), ilbmtoppm(1), imgtoppm(1),
  77.           mtvtoppm(1), pcxtoppm(1), pgmtoppm(1), pi1toppm(1),
  78.           picttoppm(1), pjtoppm(1), qrttoppm(1), rawtoppm(1),
  79.           rgb3toppm(1), sldtoppm(1), spctoppm(1), sputoppm(1),
  80.           tgatoppm(1), ximtoppm(1), xpmtoppm(1), yuvtoppm(1),
  81.           ppmtoacad(1), ppmtogif(1), ppmtoicr(1), ppmtoilbm(1),
  82.           ppmtopcx(1), ppmtopgm(1), ppmtopi1(1), ppmtopict(1),
  83.           ppmtopj(1), ppmtopuzz(1), ppmtorgb3(1), ppmtosixel(1),
  84.           ppmtotga(1), ppmtouil(1), ppmtoxpm(1), ppmtoyuv(1),
  85.           ppmdither(1), ppmforge(1), ppmhist(1), ppmmake(1),
  86.           ppmpat(1), ppmquant(1), ppmquantall(1), ppmrelief(1),
  87.           pnm(5), pgm(5), pbm(5)
  88.  
  89.      AUTHOR
  90.           Copyright (C) 1989, 1991 by Jef Poskanzer.
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.      Page 2                                          (printed 1/30/92)
  111.  
  112.  
  113.  
  114.  
  115.